﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using XmlDataCommunication;
using ConfiguationManagement;
using DataCom;

namespace ConfigurationFactory
{
    public class DataCommunicationFactory
    {
        public static IUserAccess GetUserDataAccess()
        {
            IUserAccess userDataAccess = null;
            DataBase db = CfgManager.GetDataBase();
            switch (db)
            {
                case DataBase.XML:
                    userDataAccess = new XmlUserDataAccess();
                    break;
                case DataBase.SqlServer:
                    break;
                case DataBase.Oracle:
                    break;
                default:
                    break;
            }
            return userDataAccess;
        }

        public static ILineNameAccess GetLineNameAccess()
        {
            ILineNameAccess lineNameAccess = null;
            DataBase db = CfgManager.GetDataBase();
            switch (db)
            {
                case DataBase.XML:
                    lineNameAccess = new XmlLineNameDataAccess();
                    break;
                case DataBase.SqlServer:
                    break;
                case DataBase.Oracle:
                    break;
                default:
                    break;
            }
            return lineNameAccess;
        }

        public static ILineWatchSysAccess GetLineWatchSysAccess()
        {
            ILineWatchSysAccess lineWatchSysAccess = null;
            DataBase db = CfgManager.GetDataBase();
            switch (db)
            {
                case DataBase.XML:
                    lineWatchSysAccess = new XmlLineWatchSysDataAccess();
                    break;
                case DataBase.SqlServer:
                    break;
                case DataBase.Oracle:
                    break;
                default:
                    break;
            }
            return lineWatchSysAccess;
        }

        public static IProductLogAccess GetProductLogAccess()
        {
            IProductLogAccess productLogAccess = null;
            DataBase db = CfgManager.GetDataBase();
            switch (db)
            {
                case DataBase.XML:
                    productLogAccess = new XmlProductLogDataAccess();
                    break;
                case DataBase.SqlServer:
                    break;
                case DataBase.Oracle:
                    break;
                default:
                    break;
            }
            return productLogAccess;
        }

        public static IPositionAccess GetPositionAccess()
        {
            IPositionAccess positionAccess = null;
            DataBase db = CfgManager.GetDataBase();
            switch (db)
            {
                case DataBase.XML:
                    positionAccess = new XmlPositionDataAccess();
                    break;
                case DataBase.SqlServer:
                    break;
                case DataBase.Oracle:
                    break;
                default:
                    break;
            }
            return positionAccess;
        }

        public static IPositionLogAccess GetPositionLogAccess()
        {
            IPositionLogAccess positionLogAccess = null;
            DataBase db = CfgManager.GetDataBase();
            switch (db)
            {
                case DataBase.XML:
                    positionLogAccess = new XmlPositionLogDataAccess();
                    break;
                case DataBase.SqlServer:
                    break;
                case DataBase.Oracle:
                    break;
                default:
                    break;
            }
            return positionLogAccess;
        }
    }
}
